---
title: "Replication Code for Empirical Results"
author: ''
date: "`r Sys.Date()`"
output:
  pdf_document:
    extra_dependencies: ["placeins","caption"]
  html_document: default
editor_options:
  chunk_output_type: console
---

\captionsetup[table]{labelformat=empty}
\newlength{\classpageheight} 
\setlength{\classpageheight}{\pdfpageheight}
\newlength{\classpagewidth} 
\setlength{\classpagewidth}{\pdfpagewidth}


# Preamble

We provide the replication code for the empirical results in the paper as an R markdown file. This file corresponds to the actual code we used to generate the main empirical results in the paper. To run the replication code, you will need to install R and RStudio and all the packages that we load. We recommend that you use https://cran.rstudio.com/ as your main mirror for package installation. 

# Access to the data

As per our agreement with Statistics Portugal we cannot provide the data we used in the replication package. Each researcher interested in accessing it will have to obtain permission directly from Statistics Portugal. The data we used in this project is part of Statistics Portugal's objective of making administrative data from the Portuguese tax authority and other public agencies available for statistical production and research. For information on how to access the data see the Statistics Portugal website (https://www.ine.pt/xportal/xmain?xpid=INE&xpgid=ine_pufs). You can contact Miguel Godinho de Matos (miguel.godinhomatos@ucp.pt) for advice on how to request the access to the dataset that we used.

# Replication

We provide a full run of the replication code below. Running the code on Statistics Portugal infrastructure took approximately 5 minutes on a Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-162-generic x86_64) with R version 4.2.3 (2023-03-15). The machine had 16 virtual CPUS and 774GB of RAM.

The system had the following package versions and locale configurations: 

\begin{small}
\begin{verbatim}
locale:

LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:

stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:

forcats_0.5.1          stringr_1.4.0          dplyr_1.0.7           
purrr_0.3.4            readr_2.0.1            tidyr_1.1.3           
tibble_3.1.8           ggplot2_3.3.6          tidyverse_1.3.1       
xtable_1.8-4           directlabels_2021.1.13 alpaca_0.3.3          
stargazer_5.2.2        ggthemes_4.2.4         data.table_1.14.0     
lfe_2.8-7              Matrix_1.3-4          

loaded via a namespace (and not attached):

zoo_1.8-9        tidyselect_1.1.1 haven_2.4.3      lattice_0.20-44 
colorspace_2.0-3 vctrs_0.4.2      generics_0.1.0   utf8_1.2.2      
rlang_1.0.6      pillar_1.8.1     withr_2.5.0      glue_1.6.2      
DBI_1.1.1        dbplyr_2.1.1     readxl_1.3.1     modelr_0.1.8    
lifecycle_1.0.2  cellranger_1.1.0 munsell_0.5.0    gtable_0.3.1    
rvest_1.0.1      tzdb_0.1.2       parallel_4.2.3   fansi_1.0.3     
broom_0.7.9      Rcpp_1.0.9       scales_1.2.1     backports_1.2.1 
jsonlite_1.8.2   fs_1.5.0         hms_1.1.0        stringi_1.7.4   
grid_4.2.3       quadprog_1.5-8   cli_3.4.1        tools_4.2.3     
sandwich_3.0-1   magrittr_2.0.3   Formula_1.2-4    crayon_1.4.1    
pkgconfig_2.0.3  MASS_7.3-54      ellipsis_0.3.2   xml2_1.3.3      
reprex_2.0.1     lubridate_1.7.10 rstudioapi_0.13  assertthat_0.2.1
httr_1.4.4       R6_2.5.1         compiler_4.2.3  
\end{verbatim}
\end{small}

```{css, echo=FALSE}
body .main-container {
  max-width: 1280px !important;
  width: 1280px !important;
  margin: auto;
}

body {
  max-width: 1280px !important;
  margin: auto;
}
```
    
```{r setup, include=FALSE, echo=FALSE, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls());gc()
gctorture(on =FALSE)
options(scipen=10)
Sys.setenv(LANG = "en_US.UTF-8")
Sys.setlocale("LC_TIME", "en_US.UTF-8")
source('src/util/util.texreg.R')

library(lfe)
library(data.table)
library(ggthemes)
library(stargazer)
library(alpaca)
library(directlabels)
library(xtable)
library(tidyverse)

keypath  <- '~/.ssh/'
datapath <- 'data/'
datakey  <- cyphr::data_admin_init(datapath, path_user = keypath)

dt.covid <- read_csv('data/20210914-covid_cases.csv')
dt.dataset_all <- cyphr::decrypt(readRDS('data/202220501-JPEDataset.dt.dataset_all.xz.encr.RDs'), key=datakey)
```

```{r preprocess, message=FALSE, echo=FALSE, warning=FALSE}
dt.dataset            <- dt.dataset_all[flg_public_servant == 1]
dt.data_regressions   <- dt.dataset[
    month_id %in% c('01','02','03','04','05','06','07','08','09','10','11','12') & value_all > 0
  , list(
      nif          = nif_id
    , cal_month_id = factor(cal_month_id, levels = sort(unique(cal_month_id)))
    , month_id
    , year_id
    , period
    , age_group_2017 = age_group
    , age_group      = relevel(factor(age_group_2020), '[20;49]')
    , income_group
    , age_2020
    , above_60  = ifelse(age_2020 >= 60, '>=60', '<60')
    , value_all
    , value_high
    , value_medium
    , value_low
    , value_restaurants
    , value_retail_food = value_retail_food_smarkets + value_retail_food_local
    , value_retail_food_smarkets
    , value_retail_food_local
    , value_retail_online
    , value_postalservices
    , value_travelagencies
    , value_pharmacies = value_cae_47730
    , value_hotels
    #
    , value_most_affected
    , value_not_most_affected
    #
    , pharmacy_high
    , y2018
    , y2019
    , y2020
    , y2021
    , jan
    , feb
    , mar
    , apr
    , may
    , jun
    , jul
    , aug
    , sep
    , oct
    , nov
    , dec
    , after
    , after1
    , after2)]
dt.data_regressions[, n_periods := length(unique(cal_month_id)), by = nif]
dt.data_regressions <- dt.data_regressions[n_periods > 1]
dt.data_regressions[ ,income_group_agg := 
                       ifelse(  paste(income_group) == 'IRS1 - [    0 ;  7091]' | paste(income_group) == 'IRS2 - ] 7091 ; 20261]','IRS1 - ]0 ; 20,061]',
                                ifelse(paste(income_group) == 'IRS4 - ]40522 ; 80640]' | paste(income_group) == 'IRS5 - ]80640 ; +INF[' ,'IRS4 - ]40,522 ; +Inf]',paste(income_group)))]
dt.data_regressions[, pharmacy_high_label := factor(ifelse(pharmacy_high==1,'High','Low'), levels = c('Low','High'))]
```


```{r functions, include=FALSE, echo=FALSE, message=FALSE, warning=FALSE}
coeff.effect.plot <- function( regmodel, title = '', ymin.lim=-.8, ymax.lim = 0
                              , xlabel = 'Month of the year in 2020'
                              , timegroups= c('Mar','Apr','May','Jun','Jul','Aug', 'Sep', 'Oct', 'Nov', 'Dec')
                              , agegroups = c('[20;49]','[50;59]','[60;69]','[70;79]')
                              , legend.label = NULL ){
  regcoefs <- coef(regmodel)
  regcoefs <- regcoefs[grepl('after',names(regcoefs))]
  
  regcoefs.cint <- confint(regmodel, level = .95)
  regcoefs.cint <- regcoefs.cint[grepl('after',rownames(regcoefs.cint)),]
  stopifnot(names(regcoefs) == rownames(regcoefs.cint))
  
  dt.plot.base   <-  CJ(month = factor(timegroups, levels=timegroups), age = agegroups)
  dt.plot.effect <- data.table( effect = regcoefs)
  dt.plot.cint   <- data.table(regcoefs.cint)
  setnames(dt.plot.cint, c('lb','ub'))
  dt.plot        <- cbind(dt.plot.base,dt.plot.effect, dt.plot.cint)
  if(is.null(legend.label)){
    gp <- ggplot( data = dt.plot, aes( x = month, y = effect, color = age, linetype = age, shape = age, group = age)) + 
      geom_line() + geom_point() + geom_errorbar(aes(ymin=lb, ymax=ub), width =0.1) + 
      geom_hline(yintercept = 0, linetype = 'dashed')+
      geom_dl(aes(label = paste0('    ',age)), method = list(dl.combine("last.bumpup")), cex = 1.3, hjust = 1) +
      theme_bw() + scale_color_tableau() + ylim(ymin.lim, ymax.lim) + theme(legend.position = 'none') +
      labs( x = xlabel, y = expression("Coefficients "~Delta[m]~"+"~delta[mg]~""), title = title)
  }else{
     gp <- ggplot( data = dt.plot, aes( x = month, y = effect, color = age, linetype = age, shape = age, group = age)) + 
        geom_line() + geom_point() + geom_errorbar(aes(ymin=lb, ymax=ub), width =0.1) + 
        geom_hline(yintercept = 0, linetype = 'dashed')+
        theme_bw() + scale_color_tableau() + ylim(ymin.lim, ymax.lim) + 
        labs( x = xlabel, y = expression("Coefficients "~Delta[m]~"+"~delta[mg]~""), 
              title = title, color = legend.label, shape = legend.label, linetype = legend.label) +
        theme( legend.justification = c(1, 0), legend.position = c(.99, .01), legend.box.just = "right",legend.margin = margin(6, 6, 6, 6))
  }
  
  gp
}

coeff.effect.table <- function( regmodel, title = '', ymin.lim=-.8, ymax.lim = 0
                              , xlabel = 'Month of the year in 2020'
                              , timegroups= c('Mar','Apr','May','Jun','Jul','Aug', 'Sep', 'Oct', 'Nov', 'Dec')
                              , agegroups = c('[20;49]','[50;59]','[60;69]','[70;79]')){
  regcoefs <- coef(regmodel)
  regcoefs <- regcoefs[grepl('after',names(regcoefs))]
  
  regcoefs.se <- summary(regmodel)$coefficients[,2]
  regcoefs.se <- regcoefs.se[grepl('after',names(regcoefs.se))]
  stopifnot(names(regcoefs) == rownames(regcoefs.se))
  
  regcoefs.cint <- confint(regmodel, level = .95)
  regcoefs.cint <- regcoefs.cint[grepl('after',rownames(regcoefs.cint)),]
  stopifnot(names(regcoefs) == rownames(regcoefs.cint))
  
  dt.plot.base   <-  CJ(month = factor(timegroups, levels=timegroups), age = agegroups)
  dt.plot.effect <- data.table( effect = regcoefs)
  dt.plot.se     <- data.table( stderr = regcoefs.se)
  dt.plot.cint   <- data.table(regcoefs.cint)
  setnames(dt.plot.cint, c('lb','ub'))
  dt.plot        <- cbind(dt.plot.base,dt.plot.effect,dt.plot.se, dt.plot.cint)
  dt.plot
}
```

\clearpage
# Main Empirical Results

## Table 1: Case-Fatality Rates

```{r table1}
# This table was manually created from the data sources specified in the paper.
```

## Figure 1: COVID-19 cases and deaths (reported by May 20, 2021)

```{r figure1,  fig.align='center', fig.width=16, fig.height=13, warning=FALSE, message=FALSE, echo=FALSE}
dt.covid <- dt.covid %>% mutate( cal_date = as.Date(substr(cal_date,1,10), format='%d-%m-%Y'))
dt.covid <- dt.covid %>% 
  arrange(cal_date) %>% 
  mutate( confirmed_l1 = lag(confirmed, n = 1), deaths_l1 = lag(deaths, n = 1)) %>%
  mutate( confirmed_new = confirmed - confirmed_l1, deaths_new = deaths - deaths_l1) %>%
  mutate( cal_week = format(dt.covid$cal_date,'%W'), cal_year = format(dt.covid$cal_date,'%Y'))

dt.plot <- dt.covid %>% group_by(cal_year,cal_week) %>% 
  summarize( 
      week_start    = min(cal_date)
    , week_confirmed_new = sum(confirmed_new,na.rm=T)
    , week_deaths_new    = sum(deaths_new,na.rm=T)
    , ndays              = sum(!is.na(deaths_new)))

gp.0 <- dt.plot %>% filter(ndays == 7) %>% 
  ggplot(aes( x = week_start, y = week_confirmed_new)) + geom_point() + geom_line() +
  theme_bw() + labs( y = 'COVID cases reported in Portugal',x = '')

gp.1 <- dt.plot %>% filter(ndays == 7) %>% 
  ggplot(aes( x = week_start, y = week_deaths_new)) + geom_point() + geom_line() +
  theme_bw() + labs( y = 'COVID deaths reported in Portugal', x = 'Calendar Week')  

gridExtra::grid.arrange(gp.0,gp.1)
```

\clearpage
## Figure 2: Severity of Covid-19 containment measures over time

```{r figure2}
# This figure was generated in excel. See file 20220501-JPEDataset.containmentindex.xlsx
```

## Figure 3: Changes in expenditures of public servants during the epidemic relative to a counterfactual without Covid.

```{r figure3,  fig.align='center', fig.width=14, fig.height=12, warning=FALSE, message=FALSE, echo=FALSE}
mlist <- list(
  log(value_all) ~ 
      period + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
      period:age_group + period:income_group + period:age_group:income_group | nif | 0 | nif)
reglist <- lapply(mlist, function(m) felm(m, data = dt.data_regressions, cmethod="reghdfe"))
coeff.effect.plot(
      reglist[[1]]
    , title = ''
    , ymin.lim=-.6
    , ymax.lim = .1
    , timegroups = c(
        'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
       ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
       ,'Jan-21','Feb-21','Mar-21','Apr-21')
    , xlabel = 'Month of the year'
    , legend.label = 'Age Group')
```

## Figure 4: Changes in expenditures of public servants in different income groups during the epidemic relative to a counterfactual without Covid.

```{r r figure4,  fig.align='center', fig.width=24, fig.height=32, warning=FALSE, message=FALSE, echo=FALSE}
incomegroups <- dt.data_regressions[order(income_group)][, unique(income_group_agg)]

m <- log(value_all) ~  
      period     + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
      period:age_group  | nif | 0 | nif

reglist  <- lapply(incomegroups, function(a) felm(m, data = dt.data_regressions[income_group_agg == a], cmethod="reghdfe"))
ngroups  <- sapply(incomegroups, function(a) dt.data_regressions[income_group_agg == a,length(unique(nif))])

gp.list <- lapply( 
    reglist
  , FUN = function(regobj){
    coeff.effect.plot(
      regobj
    , title = ''
    , ymin.lim= -.7
    , ymax.lim = .15
    , timegroups = c(
        'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
       ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
       ,'Jan-21','Feb-21','Mar-21','Apr-21')
    , xlabel = 'Month of the year'
    , legend.label = 'Age Group')
  })

gridExtra::grid.arrange(
    gp.list[[1]] + ggtitle(expression("Income"<="20,261"))
  , gp.list[[2]] + ggtitle(expression("20,261"< ~ "Income" <= "40,522"))
  , gp.list[[3]] + ggtitle(expression("Income ">"40,522")))
```

\clearpage
# Appendix 
##  Appendix A1 (Empirical Results) - Table 6: Descriptive Statistics, January 2018 to December 2019
### All People

```{r a1.table6.part1, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset_all %>% filter(value_all > 0 & year_id < 2020 ) %>% 
  dplyr::select(
      expense_total          = value_all
   ,  expense_farmacy        = value_cae_47730 
) %>% stargazer( . 
  , header=FALSE 
  , type ='text'
  , nobs = FALSE
  , summary.stat = c( 'mean','sd','p25','median','p75')
  , covariate.labels = c(
     'Expense p. month (All)'
    ,'Expense p. month (Pharmacy)')
  , notes = c(
    'Note: Pctl() denotes the percentile; St. Dev. is the standard deviation')
  , digits = 1
  , digits.extra = 1
  , table.placement = "!h"
)
```

### Public Servants

```{r a1.table6.part2, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset %>% filter(value_all > 0 & year_id < 2020 ) %>% 
  dplyr::select(
      expense_total          = value_all
   ,  expense_farmacy        = value_cae_47730 
) %>% stargazer(
    . 
  , header=FALSE 
  , nobs = FALSE
  , type ='text'
  , summary.stat = c( 'mean','sd','p25','median','p75')
  , covariate.labels = c(
     'Expense p. month (All)'
    ,'Expense p. month (Pharmacy)'
  )
  , notes = c(
    'Note: Pctl() denotes the percentile; St. Dev. is the standard deviation')
  , digits = 1
  , digits.extra = 1
  , table.placement = "!h")
```

### Retirees

```{r a1.table6.part3, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset_all %>% 
  filter(value_all > 0 & social_security_status == 'RETIRED' & 
         income_pension > 0 & year_id < 2020 ) %>% 
  dplyr::select(
      expense_total          = value_all
   ,  expense_farmacy        = value_cae_47730 
) %>% stargazer( . 
  , header=FALSE 
  , type ='text'
  , nobs = FALSE
  , summary.stat = c( 'mean','sd','p25','median','p75')
  , covariate.labels = c(
     'Expense p. month (All)'
    ,'Expense p. month (Pharmacy)'
  )
  , notes = c(
    'Note: Pctl() denotes the percentile; St. Dev. is the standard deviation'
  )
  , digits = 1
  , digits.extra = 1
  , table.placement = "!h")
```

\clearpage
## Appendix A1 (Empirical Results) - Table 7: Distribution of monthly expenses by age and income, January 2018 to December 2019

### Age Split (all)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset_all %>% 
  select(year_id, nif_id, age_group_2020, expense_total=value_all) %>% 
  filter(year_id < 2020) %>%
  group_by(age_group_2020) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(age_group_2020) %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

### Income Level (all)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset_all %>% select(year_id, nif_id, income_group, expense_total=value_all) %>% 
  filter(year_id < 2020) %>%
  group_by(income_group) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(income_group) %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

### Age Split (public servants)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset %>% select(year_id, nif_id, age_group_2020, expense_total=value_all) %>% 
  filter( year_id < 2020 ) %>% group_by(age_group_2020) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(age_group_2020) %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

### Income Level (public servants)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset %>% 
  select( year_id, nif_id, income_group, expense_total=value_all) %>% 
  filter(year_id < 2020) %>%
  group_by(income_group) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(income_group) %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

\clearpage
### Age Split (retired)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE , echo=FALSE}
dt.dataset_all %>% filter( year_id < 2020 & social_security_status == 'RETIRED' & income_pension > 0) %>% select(nif_id, age_group_2020, expense_total=value_all) %>%
  group_by(age_group_2020) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(age_group_2020)  %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

### Income Level (retired)

```{r, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset_all %>% 
  filter( social_security_status == 'RETIRED' & income_pension > 0 & year_id < 2020) %>% 
  select(nif_id, income_group, expense_total=value_all) %>% group_by(income_group) %>%
  summarise(
      n            = length(unique(nif_id))
    , avg_expenses = mean(expense_total)
    , sd_expenses  = sd(expense_total)
    , Q25          = quantile(expense_total, probs = 0.25)
    , Median.      = median(expense_total)
    , Q75          = quantile(expense_total, probs = 0.75)
  ) %>% arrange(income_group)  %>% data.frame() %>%  
  stargazer(summary=FALSE, type='text', digits = 1, digits.extra = 1, header = FALSE)
```

##  Appendix A1 (Empirical Results) - Figure A1: Average of the logarithm of public servants' monthly expenditures.

```{r figureA1, fig.align='center', fig.width=13, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
dt.dataset %>% filter(value_all >0 & as.double(month_id) <= 12) %>% group_by(year_id, month_id) %>%  
  summarise( avg_value = mean(log(value_all)), sd_value = sd(log(value_all)), n = n()) %>% 
  mutate(se = sd_value / sqrt(n),
         lb = avg_value - qt(1 - (0.05 / 2), n - 1) * se,
         ub = avg_value + qt(1 - (0.05 / 2), n - 1) * se
  ) %>% ggplot(., aes(x = month_id, y = avg_value, color = year_id, group = year_id, linetype = year_id, shape = year_id)) + 
   geom_line() + geom_errorbar(aes(ymin=lb, ymax=ub), width = 0.1) + geom_point() +
   scale_color_tableau() + theme_bw() +
   geom_dl(aes(label = paste0('  ',year_id)), method = list(dl.combine("last.points")), cex = 0.8) +
   labs( x = 'Calendar Month', y ='Average Log(Expenses)', color = 'Calendar Year',title = 'All Expenses') + 
   theme(legend.position = 'none') + geom_vline(xintercept = 2.5, linetype = 'dashed')
```

\FloatBarrier
\eject \pdfpageheight=13in

<!-- ## Appendix A2 (Seasonality Effects) - Table 8: Contrasting the month trends of years 2018 and 2019 -->
\thispagestyle{empty}
\tiny

```{r a2.table8, warning=FALSE, message=FALSE, echo = FALSE, results='asis'}
dt.tmp <- dt.data_regressions %>% filter( year_id < 2020 & value_all >  0)
nifs   <- dt.tmp %>% group_by(nif) %>% summarise( n = n()) %>% filter(n>1) %>% select( nif ) %>% unlist
dt.tmp <- dt.tmp %>% filter(nif %in% nifs)
agegroups   <- dt.data_regressions[order(age_2020)][, unique(age_group)]

reglist.all <- lapply(1, function(a){
  m      <- log(value_all) ~ year_id*month_id  | 0 | 0 | nif
  felm(m, data = dt.tmp, cmethod="reghdfe")
})

reglist.groups <- lapply(agegroups, function(a){
  m      <- log(value_all) ~ year_id*month_id | 0 | 0 | nif 
  dt.tmp_subgroup <- dt.tmp %>% filter( age_group == a)
  felm(m, data = dt.tmp_subgroup, cmethod="reghdfe")
})

reglist <-   c(reglist.all, reglist.groups)

wlist <- lapply( 
    reglist
  , function(x) 
      waldtest(x, ~ `year_id2019:month_id02` | 
                    `year_id2019:month_id03` | 
                    `year_id2019:month_id04` | 
                    `year_id2019:month_id05` | 
                    `year_id2019:month_id06` | 
                    `year_id2019:month_id07` | 
                    `year_id2019:month_id08` | 
                    `year_id2019:month_id09` | 
                    `year_id2019:month_id10` | 
                    `year_id2019:month_id11` | 
                    `year_id2019:month_id12`
               , type = 'robust'))


cat("\\thispagestyle{empty}")
stargazer(
    reglist
  , header=FALSE 
  , dep.var.labels = c('$Log(Expenses_{it})$')
  , column.labels = c('All', paste0(agegroups))
  , add.lines = list(
      c('Chi Sq.', sapply( wlist, function(x) format(x['chi2'], nsmall=3, digits = 1)))
    , c('p-value', sapply( wlist, function(x) format(x['p'], nsmall=3, digits = 1)))
    , rep('',length(reglist)+1)
  )
  , order = c(
     '^month_id'
    , '^year_id2019$'
    ,  'year_id2019[:]')
  , covariate.labels = c(
      'Feb ($\\lambda_{Feb}$)', 'Mar ($\\lambda_{Mar}$)', 'Apr ($\\lambda_{Apr}$)', 'May ($\\lambda_{May}$)', 
      'Jun ($\\lambda_{Jun}$)', 'Jul ($\\lambda_{Jul}$)', 'Aug ($\\lambda_{Aug}$)', 'Sep ($\\lambda_{Sep}$)', 
      'Oct ($\\lambda_{Oct}$)', 'Nov ($\\lambda_{Nov}$)', 'Dec ($\\lambda_{Dec}$)',
      'Y2019 ($\\Lambda_{2019}$)',
      'Y2019 $\\times$ Feb ($\\phi_{Feb}$)', 'Y2019 $\\times$ Mar ($\\phi_{Mar}$)', 'Y2019 $\\times$ Apr ($\\phi_{Apr}$)', 'Y2019 $\\times$ May ($\\phi_{May}$)',
      'Y2019 $\\times$ Jun ($\\phi_{Jun}$)', 'Y2019 $\\times$ Jul ($\\phi_{Jul}$)', 'Y2019 $\\times$ Aug ($\\phi_{Aug}$)', 'Y2019 $\\times$ Sep ($\\phi_{Sep}$)',
      'Y2019 $\\times$ Oct ($\\phi_{Oct}$)', 'Y2019 $\\times$ Nov ($\\phi_{Nov}$)', 'Y2019 $\\times$ Dec ($\\phi_{Dec}$)')
  , type = 'latex'
  , no.space = T
  , df       = F
  , star.char = c("+", "*", "**", "***")
  , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
  , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
    ,  'All columns estimated with person fixed effects'
    ,  'Cluster robust standard errors in (); Errors clustered by person')
 , notes.append = F
 , table.placement = '!h'
 , title = 'Appendix A2 (Seasonality Effects) - Table 8: Contrasting the month trends of years 2018 and 2019'
)
```

\FloatBarrier
\normalsize

\eject \pdfpageheight=\classpageheight

## Appendix A2 (Seasonality Effects) - Figure A2: Seasonality effects for different age groups

```{r figureA2, warning=FALSE, message=FALSE, echo = FALSE, fig.align='center', fig.width=12, fig.height=8}
groupnames <- c('All', paste0('Age',agegroups))
dt.plot    <- rbindlist(lapply( 
    1:length(reglist)
 ,  function(x){
   all.cname  <- names(coef(reglist[[x]]))
   selected   <- grepl('2019[:]',all.cname)
   bounds     <- confint(reglist[[x]])
   data.table(
        xaxis  = factor( 
                     format( seq( from = as.Date('2020-02-01'), to = as.Date('2020-12-01'), by = '1 month'),'%b')
          , levels = format( seq( from = as.Date('2020-02-01'), to = as.Date('2020-12-01'), by = '1 month'),'%b'))              
     ,  lb     = bounds[ selected , 1]
     ,  value  = coef(reglist[[x]])[ selected ]
     ,  ub     = bounds[ selected , 2]
     ,  cname  = all.cname[ selected ]
     ,  gname  = groupnames[x]
   )
 }))

dt.plot[, gname := factor(gname, levels = c('All', 'Age[20;49]','Age[50;59]','Age[60;69]','Age[70;79]'))]
ggplot( data = dt.plot , aes(x = xaxis, y = value, group = gname), color = 'gray') + 
  geom_errorbar(aes(ymin = lb, ymax = ub), width = 0.1) + geom_point() + geom_line() +
  facet_wrap(~ gname, nrow = 2) + ylim( -0.5, 0.5) + scale_color_tableau() + 
  geom_hline( yintercept = 0, linetype = 'dashed') + theme_bw() +
  labs ( x = '', y = expression("Coefficient"~phi[m]))
```

\clearpage

<!-- ## Appendix A3 (Robustness of empirical results) - Table 9: Impact of age on consumption expenditures -->

\tiny
```{r a3.table9, warning=FALSE, message=FALSE, echo = FALSE, results='asis'}
m <- log(value_all) ~  
      period     + 
      after1:mar + after1:apr + after1:may + after1:jun + after1:jul + 
      after1:aug + after1:sep + after1:oct + after1:nov + after1:dec +
      after2:jan + after2:feb + after2:mar + after2:apr +
      month_id + period:income_group | nif | 0 | nif

agegroups <- dt.data_regressions[order(age_2020)][, unique(age_group)]
reglist   <- lapply(agegroups, function(a) felm(m, data = dt.data_regressions[age_group == a], cmethod="reghdfe"))
ngroups   <- sapply(agegroups, function(a) dt.data_regressions[age_group == a,length(unique(nif))])

stargazer(
    reglist
  , header=FALSE 
  , type='latex'
  , no.space = T
  , df = F
  , order  = c('after$','after[:]', 'after1[:][a-z]{3}$','after2[:][a-z]{3}$','after2$', 'after1','after2')
  , omit   = c('^month_id','month_id[0-9]{2}$','income_group')
  , column.labels = c('$[20;49]$','$[50;59]$','$[60;69]$','$[70;79]$')
  , dep.var.labels = c('$log(Expenses_{it})$')
  , covariate.labels = c(
        '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=May20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jun20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jul20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Aug20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Sep20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Oct20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Nov20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Dec20\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jan21\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Feb21\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar21\\}$'
      , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr21\\}$'
      , '$Year_t$'
 )
 , star.char = c("+", "*", "**", "***")
 , notes.append = FALSE
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
 , notes = c(
      "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
    , 'Standard Errors clustered by person in ()')
 , add.lines = list(
   c('Month FE'               , rep('Yes',4)), 
   c('Individual FE'          , rep('Yes',4)),  
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('Yes', 'Yes', 'Yes','Yes')),
   rep('',5))
 , table.placement = "!h"
 , title = 'Appendix A3 (Robustness of empirical results) - Table 9: Impact of age on consumption expenditures '
)
```
\normalsize

\eject \pdfpageheight=15in

<!-- ## Appendix A3 (Robustness of empirical results) - Table 10: Impact of age and co-morbidity on consumption expenditure -->

\thispagestyle{empty}
\tiny
\begin{center}
```{r a3.table10 , warning=FALSE, message=FALSE, echo = FALSE, results='asis', fig.align='center', size='small'}
m <- log(value_all) ~  
      period     + 
      after1:mar + after1:apr + after1:may + after1:jun + after1:jul + 
      after1:aug + after1:sep + after1:oct + after1:nov + after1:dec +
      after2:jan + after2:feb + after2:mar + after2:apr +
      
      after1:mar:pharmacy_high + after1:apr:pharmacy_high + after1:may:pharmacy_high + after1:jun:pharmacy_high + after1:jul:pharmacy_high + 
      after1:aug:pharmacy_high + after1:sep:pharmacy_high + after1:oct:pharmacy_high + after1:nov:pharmacy_high + after1:dec:pharmacy_high +
      after2:jan:pharmacy_high + after2:feb:pharmacy_high + after2:mar:pharmacy_high + after2:apr:pharmacy_high +
      month_id + period:income_group | nif | 0 | nif

agegroups <- dt.data_regressions[order(age_2020)][, unique(age_group)]
reglist   <- lapply(agegroups, function(a) felm(m, data = dt.data_regressions[age_group == a], cmethod="reghdfe"))
ngroups   <- sapply(agegroups, function(a) dt.data_regressions[age_group == a,length(unique(nif))])

stargazer(
    reglist
  , header=FALSE 
  , type='latex'
  , no.space = T
  , df = F
  , order  = c('after$','after[:]', 'after1[:][a-z]{3}$','after2[:][a-z]{3}$','after2$', 'after1','after2')
  , omit   = c('^month_id','month_id[0-9]{2}$','income_group','period')
  , column.labels = c('$[20;49]$','$[50;59]$','$[60;69]$','$[70;79]$')
  , dep.var.labels = c('$log(Expenses_{it})$')
   , covariate.labels = c(
         '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=May20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jun20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jul20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Aug20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Sep20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Oct20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Nov20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Dec20\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jan21\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Feb21\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar21\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr21\\}$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=May20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jun20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jul20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Aug20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Sep20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Oct20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Nov20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Dec20\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Jan21\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Feb21\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Mar21\\}\\times Comorbidity$'
       , '$After_t\\times \\boldsymbol{1}\\{Month_t=Apr21\\}\\times Comorbidity$'
  )
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
 , notes.append = FALSE
 , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
    ,  'FE is the fixed effects estimator'
    ,  'Standard Errors clustered by person in ()')
 , add.lines = list(
   c('Month FE'               , rep('Yes',4)), 
   c('Individual FE'          , rep('Yes',4)),  
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('Yes', 'Yes', 'Yes','Yes')),
   rep('',5))
 , table.placement = "!h"
 , title = 'Appendix A3 (Robustness of empirical results) - Table 10: Impact of age and co-morbidity on consumption expenditure'
)
```
\end{center}

\FloatBarrier
\normalsize

\eject \pdfpageheight=15in \pdfpagewidth=11in

\clearpage
<!-- ## Appendix A3 (Robustness of empirical results) - Table 11: Impact of age heterogeneity on spending for retirees -->
\thispagestyle{empty}
\tiny
\begin{center}
```{r a3.table11,  fig.align='center', fig.width=16, fig.height=13, warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
dt.data_regressions_retired   <- dt.dataset_all[
    month_id %in% c('01','02','03','04','05','06','07','08','09','10','11','12') & value_all > 0 &
    social_security_status == 'RETIRED' & income_pension > 0
  , list(
      nif          = nif_id
    , cal_month_id = factor(cal_month_id, levels = sort(unique(cal_month_id)))
    , month_id
    , year_id
    , period
    , age_group_2017 = age_group
    , age_group      = relevel(factor(age_group_2020), '[20;49]')
    , income_group
    , age_2020
    , above_60  = ifelse(age_2020 >= 60, '>=60', '<60')
    , value_all
    , value_high
    , value_medium
    , value_low
    , value_restaurants
    , value_retail_food = value_retail_food_smarkets + value_retail_food_local
    , value_retail_food_smarkets
    , value_retail_food_local
    , value_retail_online
    , value_postalservices
    , value_travelagencies
    , value_pharmacies = value_cae_47730
    , value_hotels
    , pharmacy_high
    , y2018
    , y2019
    , y2020
    , y2021
    , jan
    , feb
    , mar
    , apr
    , may
    , jun
    , jul
    , aug
    , sep
    , oct
    , nov
    , dec
    , after
    , after1
    , after2
)]
dt.data_regressions_retired[, n_periods := length(unique(cal_month_id)), by = nif]
dt.data_regressions_retired <- dt.data_regressions_retired[n_periods > 1]

mlist <- list(
   log(value_all) ~ 
       after1:mar:above_60 + after1:apr:above_60 + after1:may:above_60 + after1:jun:above_60 + after1:jul:above_60 + 
       after1:aug:above_60 + after1:sep:above_60 + after1:oct:above_60 + after1:nov:above_60 + after1:dec:above_60 +
       after2:jan:above_60 + after2:feb:above_60 + after2:mar:above_60 + after2:apr:above_60 + month_id + 
       period  | nif | 0 | nif
    
  , log(value_all) ~ 
       after1:mar:above_60 + after1:apr:above_60 + after1:may:above_60 + after1:jun:above_60 + after1:jul:above_60 + 
       after1:aug:above_60 + after1:sep:above_60 + after1:oct:above_60 + after1:nov:above_60 + after1:dec:above_60 +
       after2:jan:above_60 + after2:feb:above_60 + after2:mar:above_60 + after2:apr:above_60 + month_id + 
       period + period:above_60 | nif | 0 | nif
  
  , log(value_all) ~ 
       after1:mar:above_60 + after1:apr:above_60 + after1:may:above_60 + after1:jun:above_60 + after1:jul:above_60 + 
       after1:aug:above_60 + after1:sep:above_60 + after1:oct:above_60 + after1:nov:above_60 + after1:dec:above_60 +
       after2:jan:above_60 + after2:feb:above_60 + after2:mar:above_60 + after2:apr:above_60 + month_id + 
       period + period:above_60 + period:income_group | nif | 0 | nif
  
  , log(value_all) ~ 
       after1:mar:above_60 + after1:apr:above_60 + after1:may:above_60 + after1:jun:above_60 + after1:jul:above_60 + 
       after1:aug:above_60 + after1:sep:above_60 + after1:oct:above_60 + after1:nov:above_60 + after1:dec:above_60 +
       after2:jan:above_60 + after2:feb:above_60 + after2:mar:above_60 + after2:apr:above_60 + month_id + 
       period + period:above_60 + period:income_group + period:above_60:income_group | nif | 0 | nif
)

reglist <- lapply(mlist, function(m) felm(m, data = dt.data_regressions_retired, cmethod="reghdfe"))
stargazer(
    reglist
 , header=FALSE 
 , dep.var.labels = c('$log(Expense_{it}$)')
 , order = c( 'period' , '^month_id[0-9]+$' , 'after1' , 'after2')
 , omit  = c( 'period' , 'month_id', 'income_group') 
, covariate.labels = c(
        '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Mar20,< 60} + \\delta_{Mar20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Mar20,\\ge 60} + \\delta_{Mar20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Apr20,< 60} + \\delta_{Apr20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Apr20,\\ge 60} + \\delta_{Apr20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{May20,< 60} + \\delta_{May20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{May20,\\ge 60} + \\delta_{May20,\\ge 60})$'
    
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Jun20,< 60} + \\delta_{Jun20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Jun20,\\ge 60} + \\delta_{Jun20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Jul20,< 60} + \\delta_{Jul20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Jul20,\\ge 60} + \\delta_{Jul20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Aug20,< 60} + \\delta_{Aug20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Aug20,\\ge 60} + \\delta_{Aug20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Sep20,< 60} + \\delta_{Sep20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Sep20,\\ge 60} + \\delta_{Sep20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Oct20,< 60} + \\delta_{Oct20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Oct20,\\ge 60} + \\delta_{Oct20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Nov20,< 60} + \\delta_{Nov20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Nov20,\\ge 60} + \\delta_{Nov20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Dec20,< 60} + \\delta_{Dec20,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Dec20,\\ge 60} + \\delta_{Dec20,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Jan21,< 60} + \\delta_{Jan21,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Jan21,\\ge 60} + \\delta_{Jan21,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Feb21,< 60} + \\delta_{Feb21,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Feb21,\\ge 60} + \\delta_{Feb21,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i < 60\\} (\\Delta_{Mar21,< 60} + \\delta_{Mar21,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Mar21,\\ge 60} + \\delta_{Mar21,\\ge 60})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i>\\} (\\Delta_{Apr21,< 60} + \\delta_{Apr21,< 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\Delta_{Apr21,\\ge 60} + \\delta_{Apr21,\\ge 60})$'
 )
 , type='latex'
 , no.space =T
 , df = FALSE
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
    , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
      ,  'Standard Errors clustered by person in ()')
  , notes.append = F
  , add.lines = list(
   c('Month FE'               , rep('Yes',4)), 
   c('Individual FE'          , rep('Yes',4)),  
   c('Age Group$\\times Year_t$ ($\\Psi_{it}$)'   , c('No', 'Yes', 'Yes','Yes')),
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'Yes','Yes')),
   c('Age Group $\\times$ Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'No','Yes')),
    rep('',5))
  , title = 'Appendix A3 (Robustness of empirical results) - Table 11: Impact of age heterogeneity on spending for retirees'
)
```
\end{center}
\FloatBarrier

\normalsize
\eject \pdfpageheight=\classpageheight \pdfpagewidth=\classpagewidth

## Appendix A3 (Robustness of empirical results) - Figure A3: Estimation results for growth rate specification.

```{r figureA3, fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE , echo=FALSE}
tb.growth <- dt.data_regressions %>% 
  arrange(nif, cal_month_id) %>% 
  group_by(nif) %>%
  mutate(
    value_all_l12 = dplyr::lag(value_all,n = 12),
    month_id_l12 = dplyr::lag(month_id,n = 12))
tb.growth <- tb.growth %>% filter(month_id == month_id_l12) 
tb.growth <- tb.growth %>% mutate(value_all_gwth = log(value_all) - log(value_all_l12))

m1 <- value_all_gwth ~ period + 
  after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
  after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
  after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
  period:age_group + period:income_group + period:age_group:income_group | nif | 0 | nif

m1.out <- felm(m1, data = tb.growth, cmethod="reghdfe")

coeff.effect.plot(
      m1.out
    , title = ''
    , ymin.lim=-.6
    , ymax.lim = .1
    , timegroups = c(
        'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
       ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
       ,'Jan-21','Feb-21','Mar-21','Apr-21')
    , xlabel = 'Month of the year'
    , legend.label = 'Age Group')
rm(tb.growth, m1, m1.out)
```

## Appendix A3 (Robustness of empirical results) - Figure A4: Changes in expenditures of public servants in the sectors least affected by lockdowns during the epidemic relative to a counterfactual without Covid

```{r figureA4,  fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
mlist <- list( 
 value_not_most_affected  ~ period + 
    after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
    after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
    after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id | nif)

nb.list <- lapply(mlist, function(m) fixest::fenegbin(m, data = dt.data_regressions))

coeff.effect.plot(
    nb.list[[1]]
  , title = 'Not most affected'
  , ymin.lim = -.5, ymax.lim =  .5
  , timegroups = c(
    'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
    ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
    ,'Jan-21','Feb-21','Mar-21','Apr-21')
  , xlabel = 'Month of the year'
  , legend.label = 'Age Group')
```

## Appendix A3 (Robustness of empirical results) - Figure A5: Estimation results excluding restaurant expenditures

```{r figureA5,  fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
mlist <- list( 
  I(value_all-value_restaurants)  ~ period + 
    after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
    after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
    after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id | nif)

nb.list <- lapply(mlist, function(m) fixest::fenegbin(m, data = dt.data_regressions))

coeff.effect.plot(
    nb.list[[1]]
  , title = 'Excluding Restaurants'
  , ymin.lim = -.5, ymax.lim =  .5
  , timegroups = c(
    'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
    ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
    ,'Jan-21','Feb-21','Mar-21','Apr-21')
  , xlabel = 'Month of the year'
  , legend.label = 'Age Group')
```

## Appendix A3 (Robustness of empirical results) - Figure A6: Estimation results excluding restaurant and super markets expenditures

```{r figureA6,  fig.align='center', fig.width=12, fig.height=6, warning=FALSE, message=FALSE, echo=FALSE}
mlist <- list( 
  I(round(value_all-value_restaurants - value_retail_food_smarkets,10))  ~ period + 
    after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
    after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
    after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id | nif)

nb.list <- lapply(mlist, function(m) fixest::fenegbin(m, data = dt.data_regressions))

coeff.effect.plot(
    nb.list[[1]]
  , title = 'Excluding Restaurants and super markets'
  , ymin.lim = -.5, ymax.lim =  .5
  , timegroups = c(
    'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
    ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
    ,'Jan-21','Feb-21','Mar-21','Apr-21')
  , xlabel = 'Month of the year'
  , legend.label = 'Age Group')
```

\clearpage
## Appendix A4 (The effect of comorbidity) - Figure A7: Changes in expenditures of public servants in different income groups during the epidemic relative to a counterfactual without covid for people with and without comorbidity


```{r figureA7,  fig.align='center', fig.width=12, fig.height=12, warning=FALSE, message=FALSE, echo=FALSE}
pharmacygroups <- dt.data_regressions[order(pharmacy_high_label)][, unique(pharmacy_high_label)]

m <- log(value_all) ~  
      period     + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      month_id + period:age_group + period:income_group + period:income_group:age_group | nif | 0 | nif

reglist   <- lapply(pharmacygroups, function(a) felm(m, data = dt.data_regressions[pharmacy_high_label == a & year_id < 2021], cmethod="reghdfe"))
ngroups   <- sapply(pharmacygroups, function(a) dt.data_regressions[pharmacy_high_label == a  & year_id < 2021,length(unique(nif))])

gp.list <- lapply( 
    reglist
  , FUN = function(regobj){
    coeff.effect.plot(
      regobj
    , title = ''
    , ymin.lim= -.7
    , ymax.lim = .3
    , timegroups = c(
        'Mar-20','Apr-20','May-20','Jun-20','Jul-20'
       ,'Aug-20','Sep-20','Oct-20','Nov-20','Dec-20'
      # ,'Jan-21','Feb-21','Mar-21','Apr-21'
      )
    , xlabel = 'Month of the year'
    , legend.label = 'Age Group')
  })

gp.grid <- gridExtra::grid.arrange(
    gp.list[[1]] + ggtitle(expression("Comorbidity = 0"))
  , gp.list[[2]] + ggtitle(expression("Comorbidity = 1")))
```

\eject \pdfpageheight=15in \pdfpagewidth=9.5in

<!-- ## Appendix A5 (Empirical Results for the analytical model) - Table 12: Impact of age on expenditures -->

\thispagestyle{empty}
\tiny
\begin{center}

```{r,  fig.align='center', fig.width=16, fig.height=13, warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
mlist <- list(
     log(value_all) ~ 
       y2020:mar + y2020:apr + y2020:may + y2020:jun + y2020:jul +
       y2020:aug + y2020:sep + y2020:oct + y2020:nov + y2020:dec +
       y2021:jan + y2021:feb + y2021:mar + y2021:apr +
       
       y2020:mar:above_60 + y2020:apr:above_60 + y2020:may:above_60 + y2020:jun:above_60 + y2020:jul:above_60 + 
       y2020:aug:above_60 + y2020:sep:above_60 + y2020:oct:above_60 + y2020:nov:above_60 + y2020:dec:above_60 +
       y2021:jan:above_60 + y2021:feb:above_60 + y2021:mar:above_60 + y2021:apr:above_60 +
       period + period:above_60 + period:income_group + period:income_group:above_60 + month_id | nif | 0 | nif
    
   , log(value_all) ~ 
       y2020:mar + y2020:apr + y2020:may + y2020:jun + y2020:jul +
       y2020:aug + y2020:sep + y2020:oct + y2020:nov + y2020:dec +
       y2021:jan + y2021:feb + y2021:mar + y2021:apr +
       
       y2020:mar:above_60 + y2020:apr:above_60 + y2020:may:above_60 + y2020:jun:above_60 + y2020:jul:above_60 + 
       y2020:aug:above_60 + y2020:sep:above_60 + y2020:oct:above_60 + y2020:nov:above_60 + y2020:dec:above_60 +
       y2021:jan:above_60 + y2021:feb:above_60 + y2021:mar:above_60 + y2021:apr:above_60 + 
       period + period:above_60 +  period:income_group +  month_id | nif | 0 | nif
     
    , log(value_all) ~ 
       y2020:mar + y2020:apr + y2020:may + y2020:jun + y2020:jul +
       y2020:aug + y2020:sep + y2020:oct + y2020:nov + y2020:dec +
       y2021:jan + y2021:feb + y2021:mar + y2021:apr +
       
       y2020:mar:above_60 + y2020:apr:above_60 + y2020:may:above_60 + y2020:jun:above_60 + y2020:jul:above_60 + 
       y2020:aug:above_60 + y2020:sep:above_60 + y2020:oct:above_60 + y2020:nov:above_60 + y2020:dec:above_60 +
       y2021:jan:above_60 + y2021:feb:above_60 + y2021:mar:above_60 + y2021:apr:above_60 + 
       period + period:above_60 + month_id | nif | 0 | nif
     
    , log(value_all) ~ 
       y2020:mar + y2020:apr + y2020:may + y2020:jun + y2020:jul +
       y2020:aug + y2020:sep + y2020:oct + y2020:nov + y2020:dec +
       y2021:jan + y2021:feb + y2021:mar + y2021:apr +
       
       y2020:mar:above_60 + y2020:apr:above_60 + y2020:may:above_60 + y2020:jun:above_60 + y2020:jul:above_60 + 
       y2020:aug:above_60 + y2020:sep:above_60 + y2020:oct:above_60 + y2020:nov:above_60 + y2020:dec:above_60 +
       y2021:jan:above_60 + y2021:feb:above_60 + y2021:mar:above_60 + y2021:apr:above_60 + 
       period + month_id | nif | 0 | nif
)

reglist <- lapply(mlist, function(m) 
  felm(m, data = dt.data_regressions %>% mutate(above_60 = ifelse(above_60=='>=60',1,0)), cmethod="reghdfe"))
stargazer(
   reglist[c(4,3,2,1)]
 , header=FALSE 
 , dep.var.labels = c('$log(Expense_{it}$)')
 , omit = c('period','month_id') 
 , order = c(
      'period'
    , '^month_id[0-9]+$'
    , '^y2020[:]mar$'
    , '^y2020[:]apr$'
    , '^y2020[:]may$'
    , '^y2020[:]jun$'
    , '^y2020[:]jul$'
    , '^y2020[:]aug$'
    , '^y2020[:]sep$'
    , '^y2020[:]oct$'
    , '^y2020[:]nov$'
    , '^y2020[:]dec$'
    , '^y2021[:]jan$'
    , '^y2021[:]feb$'
    , '^mar[:]y2021$'
    , '^apr[:]y2021$'
    , '^y2020[:]mar'
    , '^y2020[:]apr'
    , '^y2020[:]may'
    , '^y2020[:]jun'
    , '^y2020[:]jul'
    , '^y2020[:]aug'
    , '^y2020[:]sep'
    , '^y2020[:]oct'
    , '^y2020[:]nov'
    , '^y2020[:]dec'
    , '^y2021[:]jan'
    , '^y2021[:]feb'
    , '^mar[:]y2021'
    , '^apr[:]y2021')
 , column.labels = rep(c('FE'), 6)
 , covariate.labels = c(
        '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} (\\Delta_{Mar20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} (\\Delta_{Apr20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} (\\Delta_{May20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} (\\Delta_{Jun20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} (\\Delta_{Jul20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} (\\Delta_{Aug20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} (\\Delta_{Sep20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} (\\Delta_{Oct20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} (\\Delta_{Nov20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} (\\Delta_{Dec20})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} (\\Delta_{Jan21})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} (\\Delta_{Feb21})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} (\\Delta_{Mar21})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} (\\Delta_{Apr21})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Mar20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Apr20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{May20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Jun20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Jul20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Aug20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Sep20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Oct20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Nov20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Dec20,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Jan21,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Feb21,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Mar21,\\ge 60})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i\\ge 60\\} (\\delta_{Apr21,\\ge 60})$'
 )
 , type = 'latex'
 , no.space =T
 , df = FALSE
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
 , notes = c( "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001",'Standard Errors clustered by person in ()')
 , notes.append = F
 , add.lines = list(
     c('Month FE'               , rep('Yes',4)), 
     c('Individual FE'          , rep('Yes',4)),  
     c('Age Group$\\times Year_t$ ($\\Psi_{it}$)'   , c('No', 'Yes', 'Yes','Yes')),
     c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'Yes','Yes')),
     c('Age Group $\\times$ Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'No','Yes')),
      rep('',5))
 , table.placement = "!h"
 , title = 'Appendix A5 (Empirical Results for the analytical model) - Table 12: Impact of age on expenditures'
)
```
\end{center}
\FloatBarrier

\normalsize

\eject \pdfpageheight=18in \pdfpagewidth=10in
\clearpage

<!-- ## Appendix A6 (Regression tables used for the figures) - Table 13: Impact of age on consumption expenditures -->

\thispagestyle{empty}
\tiny

```{r, warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
mlist <- list(
    log(value_all)  ~  after + period + month_id | nif | 0 | nif
  , log(value_all)  ~  after:age_group + period + month_id | nif | 0 | nif
  , log(value_all)  ~  after:age_group + period + period:age_group + month_id | nif | 0 | nif
  , log(value_all)  ~  after:age_group + period + period:age_group + period:income_group + month_id | nif | 0 | nif
  , log(value_all)  ~  after:age_group + period + period:age_group + period:income_group +  period:income_group:age_group + month_id | nif | 0 | nif
)

reglist <- lapply(mlist, function(m) felm(m, data = dt.data_regressions, cmethod="reghdfe"))
stargazer(
    reglist
  , header=FALSE 
  , type='latex'
  , no.space = T
  , df = F
  , order  = c('after$','after[:]', 'month_id','period')
  , dep.var.labels = c('$log(Expenses_{it})$')
   , covariate.labels = c(
         '$After_{t}$'
        ,'$After_{t} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\}$'
        ,'$After_{t} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}$'
        ,'$After_{t} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}$'
        ,'$After_{t} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}$'
        
        , '$\\boldsymbol{1}\\{Month_t=Feb\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Mar\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Apr\\}$'
        , '$\\boldsymbol{1}\\{Month_t=May\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Jun\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Jul\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Aug\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Sep\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Oct\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Nov\\}$'
        , '$\\boldsymbol{1}\\{Month_t=Dec\\}$'
        
        , '$Year_t$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}$'
        
        , '$Year_t \\times \\boldsymbol{1}\\{Income_i=] 7,091;20,261]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Income_i=]20,261;40,522]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Income_i=]40,522;80,640]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Income_i=>80,640\\}$'
        
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}\\times \\boldsymbol{1}\\{Income_i=]7,091;20,261]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}\\times \\boldsymbol{1}\\{Income_i=]7,091;20,261]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}\\times \\boldsymbol{1}\\{Income_i=]7,091;20,261]\\}$'
        
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}\\times \\boldsymbol{1}\\{Income_i=]20,261;40,522]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}\\times \\boldsymbol{1}\\{Income_i=]20,261;40,522]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}\\times \\boldsymbol{1}\\{Income_i=]20,261;40,522]\\}$'
        
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}\\times \\boldsymbol{1}\\{Income_i=]40,522;80,640]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}\\times \\boldsymbol{1}\\{Income_i=]40,522;80,640]\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}\\times \\boldsymbol{1}\\{Income_i=]40,522;80,640]\\}$'
        
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[50;59]\\}\\times \\boldsymbol{1}\\{Income_i>80,640\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[60;69]\\}\\times \\boldsymbol{1}\\{Income_i>80,640\\}$'
        , '$Year_t \\times \\boldsymbol{1}\\{Age_i=[70;79]\\}\\times \\boldsymbol{1}\\{Income_i>80,640\\}$'
      )
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
    , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
    ,  'Standard Errors clustered by person in ()')
 , add.lines = list(
   c('Individual FE'          , rep('Yes',5)),  
   c('Age Group $\\times Year_t$ ($\\Psi_{it}$)'   , c('No', 'Yes','Yes', 'Yes','Yes')),
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No','No', 'Yes','Yes')),
   c('Age Group $\\times$ Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No','No', 'No','Yes')),
    rep('',5))
 , table.placement = "!h"
 , title = 'Appendix A6 (Regression tables used for the figures) - Table 13: Impact of age on consumption expenditures'
)
```

\FloatBarrier
\normalsize
\eject \pdfpageheight=24in \pdfpagewidth=11in
<!-- ## Appendix A6 (Regression tables used for the figures) - Table 14: Impact of age on consumption expenditure (main plot results) -->
\thispagestyle{empty}

```{r,  fig.align='center', fig.width=16, fig.height=13, warning=FALSE, message=FALSE, echo=FALSE, results = 'asis'}
mlist <- list(
     log(value_all) ~ 
       period + 
       after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
       after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
       after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id | nif | 0 | nif
    
  , log(value_all) ~ 
      period +  
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id +
      period:age_group | nif | 0 | nif
  
  , log(value_all) ~ 
      period + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
      period:age_group     + period:income_group | nif | 0 | nif
  
  , log(value_all) ~ 
      period + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
      period:age_group + period:income_group + period:age_group:income_group | nif | 0 | nif
)

reglist <- lapply(mlist, function(m) felm(m, data = dt.data_regressions, cmethod="reghdfe"))

stargazer(
   reglist
 , dep.var.labels = c('$log(Expense_{it}$)')
 , order = c( 'period' , '^month_id[0-9]+$' , 'after1' , 'after2')
 , omit  = c( 'period' , 'month_id', 'income_group') 
 , covariate.labels = c(
         '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Mar20,[20;49]} + \\delta_{Mar20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Mar20,[50;59]} + \\delta_{Mar20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Mar20,[60;69]} + \\delta_{Mar20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Mar20,[70;79]} + \\delta_{Mar20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Apr20,[20;49]} + \\delta_{Apr20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Apr20,[50;59]} + \\delta_{Apr20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Apr20,[60;69]} + \\delta_{Apr20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Apr20,[70;79]} + \\delta_{Apr20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{May20,[20;49]} + \\delta_{May20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{May20,[50;59]} + \\delta_{May20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{May20,[60;69]} + \\delta_{May20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{May20,[70;79]} + \\delta_{May20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jun20,[20;49]} + \\delta_{Jun20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jun20,[50;59]} + \\delta_{Jun20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jun20,[60;69]} + \\delta_{Jun20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jun20,[70;79]} + \\delta_{Jun20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jul20,[20;49]} + \\delta_{Jul20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jul20,[50;59]} + \\delta_{Jul20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jul20,[60;69]} + \\delta_{Jul20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jul20,[70;79]} + \\delta_{Jul20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Aug20,[20;49]} + \\delta_{Aug20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Aug20,[50;59]} + \\delta_{Aug20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Aug20,[60;69]} + \\delta_{Aug20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Aug20,[70;79]} + \\delta_{Aug20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Sep20,[20;49]} + \\delta_{Sep20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Sep20,[50;59]} + \\delta_{Sep20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Sep20,[60;69]} + \\delta_{Sep20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Sep20,[70;79]} + \\delta_{Sep20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Oct20,[20;49]} + \\delta_{Oct20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Oct20,[50;59]} + \\delta_{Oct20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Oct20,[60;69]} + \\delta_{Oct20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Oct20,[70;79]} + \\delta_{Oct20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Nov20,[20;49]} + \\delta_{Nov20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Nov20,[50;59]} + \\delta_{Nov20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Nov20,[60;69]} + \\delta_{Nov20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Nov20,[70;79]} + \\delta_{Nov20,[70;79]})$'

      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Dec20,[20;49]} + \\delta_{Dec20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Dec20,[50;59]} + \\delta_{Dec20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Dec20,[60;69]} + \\delta_{Dec20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Dec20,[70;79]} + \\delta_{Dec20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jan21,[20;49]} + \\delta_{Jan21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jan21,[50;59]} + \\delta_{Jan21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jan21,[60;69]} + \\delta_{Jan21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jan21,[70;79]} + \\delta_{Jan21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Feb21,[20;49]} + \\delta_{Feb21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Feb21,[50;59]} + \\delta_{Feb21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Feb21,[60;69]} + \\delta_{Feb21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Feb21,[70;79]} + \\delta_{Feb21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Mar21,[20;49]} + \\delta_{Mar21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Mar21,[50;59]} + \\delta_{Mar21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Mar21,[60;69]} + \\delta_{Mar21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Mar21,[70;79]} + \\delta_{Mar21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Apr21,[20;49]} + \\delta_{Apr21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Apr21,[50;59]} + \\delta_{Apr21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Apr21,[60;69]} + \\delta_{Apr21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Apr21,[70;79]} + \\delta_{Apr21,[70;79]})$'
 )
 , header = FALSE
 , type='latex'
 , no.space =T
 , df = FALSE
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
    , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
      ,  'Standard Errors clustered by person in ().')
  , notes.append = F
  , add.lines = list(
   c('Month FE'               , rep('Yes',4)), 
   c('Individual FE'          , rep('Yes',4)),  
   c('Age Group$\\times Year_t$ ($\\Psi_{it}$)'   , c('No', 'Yes', 'Yes','Yes')),
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'Yes','Yes')),
   c('Age Group $\\times$ Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('No', 'No', 'No','Yes')),
    rep('',5))
 , title = 'Appendix A6 (Regression tables used for the figures) - Table 14: Impact of age on consumption expenditure (main plot results)'
)
```

\FloatBarrier
\clearpage
<!-- ## Appendix A6 (Regression tables used for the figures)- Table 15: Impact of age on consumption expenditures by income group -->
\thispagestyle{empty}
\tiny

```{r,  fig.align='center', fig.width=24, fig.height=48, warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
dt.data_regressions[ ,income_group_agg := 
      ifelse(  paste(income_group) == 'IRS1 - [    0 ;  7091]' | paste(income_group) == 'IRS2 - ] 7091 ; 20261]','IRS1 - ]0 ; 20,061]',
        ifelse(paste(income_group) == 'IRS4 - ]40522 ; 80640]' | paste(income_group) == 'IRS5 - ]80640 ; +INF[' ,'IRS4 - ]40,522 ; +Inf]',paste(income_group)))]
incomegroups <- dt.data_regressions[order(income_group)][, unique(income_group_agg)]

m <- log(value_all) ~  
      period     + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      after2:jan:age_group + after2:feb:age_group + after2:mar:age_group + after2:apr:age_group + month_id + 
      period:age_group  | nif | 0 | nif

reglist  <- lapply(incomegroups, function(a) felm(m, data = dt.data_regressions[income_group_agg == a], cmethod="reghdfe"))
ngroups  <- sapply(incomegroups, function(a) dt.data_regressions[income_group_agg == a,length(unique(nif))])

stargazer(
    reglist
  , header = FALSE
  , dep.var.labels = c('$Log(Expenses_{it})$')
  , column.labels = c('$20,061 \\le$', ']20,061 ; 40,522]', '$\\ge 40,522$')
  , order = c( 'period' , '^month_id[0-9]+$' , 'after1' , 'after2')
  , omit  = c('period'  ,'month_id')
  , covariate.labels = c(
         '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Mar20,[20;49]} + \\delta_{Mar20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Mar20,[50;59]} + \\delta_{Mar20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Mar20,[60;69]} + \\delta_{Mar20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Mar20,[70;79]} + \\delta_{Mar20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Apr20,[20;49]} + \\delta_{Apr20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Apr20,[50;59]} + \\delta_{Apr20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Apr20,[60;69]} + \\delta_{Apr20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Apr20,[70;79]} + \\delta_{Apr20,[70;79]})$'
      
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{May20,[20;49]} + \\delta_{May20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{May20,[50;59]} + \\delta_{May20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{May20,[60;69]} + \\delta_{May20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{May20,[70;79]} + \\delta_{May20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jun20,[20;49]} + \\delta_{Jun20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jun20,[50;59]} + \\delta_{Jun20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jun20,[60;69]} + \\delta_{Jun20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jun20,[70;79]} + \\delta_{Jun20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jul20,[20;49]} + \\delta_{Jul20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jul20,[50;59]} + \\delta_{Jul20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jul20,[60;69]} + \\delta_{Jul20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jul20,[70;79]} + \\delta_{Jul20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Aug20,[20;49]} + \\delta_{Aug20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Aug20,[50;59]} + \\delta_{Aug20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Aug20,[60;69]} + \\delta_{Aug20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Aug20,[70;79]} + \\delta_{Aug20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Sep20,[20;49]} + \\delta_{Sep20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Sep20,[50;59]} + \\delta_{Sep20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Sep20,[60;69]} + \\delta_{Sep20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Sep20,[70;79]} + \\delta_{Sep20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Oct20,[20;49]} + \\delta_{Oct20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Oct20,[50;59]} + \\delta_{Oct20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Oct20,[60;69]} + \\delta_{Oct20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Oct20,[70;79]} + \\delta_{Oct20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Nov20,[20;49]} + \\delta_{Nov20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Nov20,[50;59]} + \\delta_{Nov20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Nov20,[60;69]} + \\delta_{Nov20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Nov20,[70;79]} + \\delta_{Nov20,[70;79]})$'

      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Dec20,[20;49]} + \\delta_{Dec20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Dec20,[50;59]} + \\delta_{Dec20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Dec20,[60;69]} + \\delta_{Dec20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Dec20,[70;79]} + \\delta_{Dec20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jan21,[20;49]} + \\delta_{Jan21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jan21,[50;59]} + \\delta_{Jan21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jan21,[60;69]} + \\delta_{Jan21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jan21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jan21,[70;79]} + \\delta_{Jan21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Feb21,[20;49]} + \\delta_{Feb21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Feb21,[50;59]} + \\delta_{Feb21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Feb21,[60;69]} + \\delta_{Feb21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Feb21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Feb21,[70;79]} + \\delta_{Feb21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Mar21,[20;49]} + \\delta_{Mar21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Mar21,[50;59]} + \\delta_{Mar21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Mar21,[60;69]} + \\delta_{Mar21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Mar21,[70;79]} + \\delta_{Mar21,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Apr21,[20;49]} + \\delta_{Apr21,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Apr21,[50;59]} + \\delta_{Apr21,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Apr21,[60;69]} + \\delta_{Apr21,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr21\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Apr21,[70;79]} + \\delta_{Apr21,[70;79]})$'
 )
 , add.lines = list(c('Groups', ngroups))
 , type = 'latex'
  , no.space = T
  , df       = F
  , star.char = c("+", "*", "**", "***")
  , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
    , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
    ,  'All columns estimated with person fixed effects'
    ,  'Standard Errors clustered by person in ()')
  , notes.append = F
  , title  = 'Appendix A6 (Regression tables used for the figures)- Table 15: Impact of age on consumption expenditures by income group'
)
```

\FloatBarrier
\normalsize

\clearpage
<!-- ## Appendix A6 - Table 16: Changes in expenditures of public servants in different income groups during the epidemic relative to a counterfactual without covid for people with and without comorbidity -->

\tiny
\thispagestyle{empty}

```{r,  fig.align='center', fig.width=16, fig.height=39, warning=FALSE, message=FALSE, echo=FALSE,results='asis'} 
pharmacygroups <- dt.data_regressions[order(pharmacy_high_label)][, unique(pharmacy_high_label)]

m <- log(value_all) ~ 
      period + 
      after1:mar:age_group + after1:apr:age_group + after1:may:age_group + after1:jun:age_group + after1:jul:age_group + 
      after1:aug:age_group + after1:sep:age_group + after1:oct:age_group + after1:nov:age_group + after1:dec:age_group +
      month_id + period:age_group + period:income_group + period:age_group:income_group | nif | 0 | nif

reglist <- lapply(pharmacygroups, function(a) felm(m, data = dt.data_regressions[pharmacy_high_label == a], cmethod="reghdfe"))
ngroups <- sapply(pharmacygroups, function(a) dt.data_regressions[pharmacy_high_label == a,length(unique(nif))])

stargazer(
   reglist
 , header=FALSE 
 , dep.var.labels = c('$log(Expense_{it}$)')
 , order = c( 'period' , '^month_id[0-9]+$' , 'after1' , 'after2')
 , omit  = c( 'period' , 'month_id', 'income_group') 
 , covariate.labels = c(
        '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Mar20,[20;49]} + \\delta_{Mar20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Mar20,[50;59]} + \\delta_{Mar20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Mar20,[60;69]} + \\delta_{Mar20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Mar20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Mar20,[70;79]} + \\delta_{Mar20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Apr20,[20;49]} + \\delta_{Apr20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Apr20,[50;59]} + \\delta_{Apr20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Apr20,[60;69]} + \\delta_{Apr20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Apr20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Apr20,[70;79]} + \\delta_{Apr20,[70;79]})$'
      
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{May20,[20;49]} + \\delta_{May20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{May20,[50;59]} + \\delta_{May20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{May20,[60;69]} + \\delta_{May20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=May20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{May20,[70;79]} + \\delta_{May20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jun20,[20;49]} + \\delta_{Jun20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jun20,[50;59]} + \\delta_{Jun20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jun20,[60;69]} + \\delta_{Jun20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jun20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jun20,[70;79]} + \\delta_{Jun20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Jul20,[20;49]} + \\delta_{Jul20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Jul20,[50;59]} + \\delta_{Jul20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Jul20,[60;69]} + \\delta_{Jul20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Jul20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Jul20,[70;79]} + \\delta_{Jul20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Aug20,[20;49]} + \\delta_{Aug20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Aug20,[50;59]} + \\delta_{Aug20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Aug20,[60;69]} + \\delta_{Aug20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Aug20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Aug20,[70;79]} + \\delta_{Aug20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Sep20,[20;49]} + \\delta_{Sep20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Sep20,[50;59]} + \\delta_{Sep20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Sep20,[60;69]} + \\delta_{Sep20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Sep20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Sep20,[70;79]} + \\delta_{Sep20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Oct20,[20;49]} + \\delta_{Oct20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Oct20,[50;59]} + \\delta_{Oct20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Oct20,[60;69]} + \\delta_{Oct20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Oct20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Oct20,[70;79]} + \\delta_{Oct20,[70;79]})$'
      
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Nov20,[20;49]} + \\delta_{Nov20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Nov20,[50;59]} + \\delta_{Nov20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Nov20,[60;69]} + \\delta_{Nov20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Nov20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Nov20,[70;79]} + \\delta_{Nov20,[70;79]})$'

      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[20;49]\\} (\\Delta_{Dec20,[20;49]} + \\delta_{Dec20,[20;49]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[50;59]\\} (\\Delta_{Dec20,[50;59]} + \\delta_{Dec20,[50;59]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[60;69]\\} (\\Delta_{Dec20,[60;69]} + \\delta_{Dec20,[60;69]})$'
      , '$After_t \\times \\boldsymbol{1}\\{Month_t=Dec20\\} \\times \\boldsymbol{1}\\{Age_i=[70;79]\\} (\\Delta_{Dec20,[70;79]} + \\delta_{Dec20,[70;79]})$'
      )
 , type='latex'
 , no.space =T
 , df = FALSE
 , star.char = c("+", "*", "**", "***")
 , star.cutoffs = c(0.1, 0.05, 0.01, 0.001)
    , notes = c(
        "+ p$<$0.1; * p$<$0.05; ** p$<$0.01; *** p$<$0.001"
      , 'Standard Errors clustered by person in ()')
 , notes.append = F
 , add.lines = list(
   c('Month FE'               , rep('Yes',2)), 
   c('Individual FE'          , rep('Yes',2)),  
   c('Age Group$\\times Year_t$ ($\\Psi_{it}$)'   , c('Yes', 'Yes')),
   c('Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('Yes', 'Yes')),
   c('Age Group $\\times$ Income Group $\\times Year_t$ ($\\Psi_{it}$)', c('Yes','Yes')),
    rep('',5))
 , title = 'Appendix A6 (Regression tables used for the figures) - Table 16: Changes in expenditures of public servants in different income groups during the epidemic relative to a counterfactual without covid for people with and without comorbidity'
)
```

\FloatBarrier
\eject \pdfpageheight=\classpageheight \pdfpagewidth=\classpagewidth






